Memory system and method for controlling nonvolatile memory

ABSTRACT

According to one embodiment, a memory system manages a plurality of parallel units each including blocks belonging to different nonvolatile memory dies. When receiving from a host a write request designating a third address to identify first data to be written, the memory system selects one block from undefective blocks included in one parallel unit as a write destination block by referring to defect information, determines a write destination location in the selected block, and writes the first data to the write destination location. The memory system notifies the host of a first physical address indicative of both of the selected block and the write destination location, and the third address.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is based upon and claims the benefit of priority fromJapanese Patent Application No. 2017-209317, filed Oct. 30, 2017, theentire contents of which are incorporated herein by reference.

FIELD

Embodiments described herein relate generally to a technology ofcontrolling a nonvolatile memory.

BACKGROUND

In recent years, memory systems comprising nonvolatile memories havebeen widely prevalent. As such a memory system, a solid state drive(SSD) based on a NAND flash technology is known.

SSD is also used as the storage in a server of the data center.

The storage used in a host computing system such as a server is requiredto exert high-level I/O performance.

For this reason, a new interface between a host and a storage has beenrecently proposed.

However, if the number of defective blocks included in the nonvolatilememory is increased, increase in the amount of replacement informationto replace the defective blocks with the other blocks and increase inthe read latency time due to a processing for this replacement mayoccur.

Accordingly, implement of a new technology of reducing an influencewhich results from increase in the defective blocks has been required.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram showing a relationship between a host and amemory system (flash storage device).

FIG. 2 is a diagram for explanation of role sharing between the host andthe flash storage device.

FIG. 3 is a block diagram showing a configuration example of the flashstorage device.

FIG. 4 is a table showing commands for In-Drive-GC API.

FIG. 5 is a table showing commands for super block API.

FIG. 6 is a block diagram showing a relationship between a flash I/Ocontrol circuit and plural NAND flash memory dies provided in the flashstorage device.

FIG. 7 is a diagram showing a configuration example of a super block(parallel unit) configured by a set of plural blocks.

FIG. 8 is a diagram for explanation of a relationship between a blockaddress of the super block and block addresses the plural blocksconstituting the super block.

FIG. 9 is a diagram for explanation of an operation of replacingdefective blocks belonging to a certain nonvolatile memory die with theother blocks in this nonvolatile memory die, respectively.

FIG. 10 is a diagram for explanation of an operation of selecting awrite destination block from undefective blocks in the super blockwithout replacing the defective blocks.

FIG. 11 is a table for explanation of a write command applied to theflash storage device.

FIG. 12 is a table for explanation of a response to the write commandshown in FIG. 11.

FIG. 13 is a table for explanation of a Trim command applied to theflash storage device.

FIG. 14 is a diagram showing an operation of writing data to the superblock including a defective block.

FIG. 15 is a diagram showing configuration examples of the physicaladdress included in the response shown in FIG. 12.

FIG. 16 is a diagram for explanation of a relationship between the blockaddress of the super block and the block address of each of the blocksincluded in the super block.

FIG. 17 is a block diagram for explanation of an operation of writing apair of a logical address and data to a page in a block.

FIG. 18 is a block diagram for explanation of an operation of writingdata to a user data region of the page in the block and writing thelogical address of the data to a redundant region of the page.

FIG. 19 is a diagram for explanation of writing plural data portions andan erasure code calculated from the data portions to the super blockhaving a defective block.

FIG. 20 is a block diagram showing a relationship between a flashtranslation unit in the host and a write operation control unit in theflash storage device.

FIG. 21 is a block diagram for explanation of a write operation and aread operation executed by the host and the flash storage device.

FIG. 22 is a sequence chart showing a sequence of write operationprocessing executed by the host and the flash storage device.

FIG. 23 is a block diagram showing a data update operation of writingupdate data for already written data.

FIG. 24 is a diagram for explanation of an operation of updating a blockmanagement table managed by the flash storage device.

FIG. 25 is a diagram for explanation of an operation of updating alookup table (logical-to-physical address translation table) managed bythe host.

FIG. 26 is a diagram for explanation of an operation of updating theblock management table in response to a notification from the hostindicative of a physical address corresponding to data which should beinvalidated.

FIG. 27 is a table for explanation of the read command applied to theflash storage device.

FIG. 28 is a diagram for explanation or the read operation executed bythe flash storage device.

FIG. 29 is a sequence chart showing a sequence of read processingexecuted by the host and the flash storage device.

FIG. 30 is a table for explanation of a garbage collection (GC) controlcommand applied to the flash storage device.

FIG. 31 is a table for explanation of a forced garbage collection (GC)control command applied to the flash storage device.

FIG. 32 is a table for explanation of address update notificationtransmitted from the flash storage device to the host.

FIG. 33 is a sequence chart showing a procedure of the garbagecollection (GC) operation executed by the flash storage device.

FIG. 34 is a diagram for explanation of an example of a data copyoperation executed for the garbage collection (GC).

FIG. 35 is an illustration for explanation of contents of a lookup tableof the host updated based on a result of the data copy operation shownin FIG. 34.

FIG. 36 is a diagram for explanation of a relationship between theresponse to the write command and the callback processing for GC(address update notification).

FIG. 37 is a flowchart showing steps of the lookup table updateprocessing executed by the host.

FIG. 38 is a diagram showing a configuration example of a blockmanagement table for management of a reference count.

FIG. 39 is a table for explanation of a duplicate command applied to theflash storage device.

FIG. 40 is a sequence chart showing reference count increment/decrementprocessing executed by the host and the flash storage device.

FIG. 41 is a flowchart showing a procedure of super block allocatingprocessing executed by the flash storage device.

FIG. 42 is a diagram for explanation of an address translating operationof translating an address of the block to be accessed such that allundefective blocks in the super block are logically arrangedsequentially from a leading part of the super block.

FIG. 43 is a diagram for explanation of an example of the addresstranslation and a defect information management table used for theaddress translation operation.

FIG. 44 is a block diagram showing a relationship between a flashtranslation unit in the host and a defective block translation unit inthe flash storage device.

FIG. 45 is a block diagram showing a configuration example of the host(computing system).

FIG. 46 is a perspective view showing a configuration example of thehost built in the flash storage device.

FIG. 47 is a flowchart showing steps of the write operation executed bythe host.

FIG. 48 is a flowchart showing steps of the read operation executed bythe host.

FIG. 49 is a flowchart showing steps of reference countincrement/decrement processing executed by the host.

DETAILED DESCRIPTION

Various embodiments will be described hereinafter with reference to theaccompanying drawings.

In general, according to one embodiment, a memory system connectable toa host, comprises a plurality of nonvolatile memory dies each includinga plurality of blocks, and a controller electrically connected to thenonvolatile memory dies and configured to manage a plurality of parallelunits each including blocks belonging to different nonvolatile memorydies.

Each of the parallel units has a unique first block address, each of theblocks in each nonvolatile memory die has a unique second block address,and second block addresses of blocks to be included in each parallelunit are determined from the first block address of each parallel unit,based on a mathematical rule.

The controller manages defect information holding at least 1-bitinformation indicative of being available or unavailable for each blockin each parallel unit.

When receiving from the host a write request designating a third addressto identify first data to be written, the controller selects one clockfrom undefective blocks included in one parallel unit as a writedestination block by referring to the defect information, determines awrite destination location in the selected block, writes the first datato the write destination location, and notifies the host of a firstphysical address indicative of both of the selected block and the writedestination location, and the third address.

First, a relationship between the host and the memory system will beexplained with reference to FIG. 1.

The memory system is a semiconductor storage device configured to writedata to a nonvolatile memory and to read data from the nonvolatilememory. The memory system is implemented as a flash storage device 3based on the NAND flash technology.

The host (host device) 2 is configured to control plural flash storagedevices 3. The host 2 is implemented by a computing system configured touse a flash array composed of the plural flash storage devices 3 as astorage. This computing system may be a server.

The flash storage device 3 may be utilized as one of plural flashstorage devices provided in the storage array. The storage array may beconnected to the computing system such as a server via a cable or anetwork. The storage array comprises a controller which controls pluralstorages (for example, plural flash storage devices 3) in the storagearray. If the flash storage devices 3 are applied to the storage array,the controller of the storage array may function as the host of theflash storage devices 3.

An example in which the computing system such as the server functions asthe host 2 will be explained below.

The host (server) 2 and the plural flash storage devices 3 areinterconnected via an interface 50 (internal interconnection). Theinterface 50 for the internal interconnection is not limited to this,but PCI Express (PCIe) (registered trademark), NVM Express (NVMe)(registered trademark), Ethernet (registered trademark), NVMe overFabrics (NVMeOF), and the like can be used as the interface.

A typical example of a server functioning as the host 2 is a server in adata center.

In a case where the host 2 is implemented by the server in the datacenter, the host (server) 2 may be connected to plural end userterminals (clients) 61 via a network 51. The host 2 can provide variousservices to the end user terminals 61.

Examples of services which can be provided by the host (server) 2 are(1) Platform as a Service (PaaS) which provides a system runningplatform to each client (each end user terminal 61), (2) Infrastructureas a Service (IaaS) which provides an infrastructure such as a virtualserver to each client (each end user terminal 61), and the like.

Plural virtual machines may be executed on a physical server functioningas the host (server) 2. Each of the virtual machines running on the host(server) 2 can function as a virtual server configured to providevarious services to several corresponding clients (end user terminals61).

The host (server) 2 comprises a storage management function of managingthe plural flash storage devices 3 constituting a flash array, and afront-end function of providing various services including the storageaccess to the end user terminals 61.

In the conventional SSD, a block/page hierarchical structure of a NANDflash memory is concealed by a flash translation layer (FTL) in SSD. Inother words, FTL of the conventional SSD comprises (1) the function ofmanaging mapping between each of the logical addresses and each of thephysical addresses of the NAND flash memory, by using the lookup tablewhich functions as the logical-to-physical address translation table,(2) the function of concealing read/write in page units and the eraseoperation in block units, (3) the function of executing the garbagecollection (GC) of the NAND flash memory, and the like. Mapping betweeneach of the logical addresses and each of physical addresses of the NANDflash memory cannot be seen from the host. The block/page structure ofthe NAND flash memory cannot be seen from the host, either.

A type of address translation (application-level address translation) isoften executed in the host, too. This address translation managesmapping between each of the application-level logical addresses and eachof the logical addresses for SSD, using the application-level addresstranslation table. In addition, in the host, too, a type of GC(application-level GC) for change of data placement in the logicaladdress space is often executed for cancellation of a fragment whichoccurs in the logical address space for SSD.

In a redundant configuration in which each of the host and SSD includesthe address translation table (in which SSD includes the lookup tablefunctioning as the logical-to-physical address translation table whilethe host includes the application-level address translation table),however, enormous volumes of memory resources are consumed to hold theseaddress translation tables. Furthermore, duplex address translationincluding the address translation on the host side and the addresstranslation on the SSD side is also a factor which degrades the I/Operformance of the entire system.

Furthermore, the application-level GC on the host side becomes a factorwhich increases the amount of data written to SSD to a multiple (forexample, double) of actual user data amount. Increase of the data writeamount does not increase the write amplification of SSD, but degradesthe storage performance of the entire system and shortens the life ofSSD.

Thus, in the present embodiments, the role of FTL is shared by the host2 and the flash storage device 3. The host 2 manages the lookup tablewhich functions as the logical-to-physical address translation table,but the blocks and pages which should be used for write can bedetermined by not the host 2, but flash storage device 3. In addition,GC can also be executed by not the host 2, but the flash storage device3. The FTL function moved to the host 2 is hereinafter called globalFTL.

In addition, the flash storage device 3 manages plural parallel units(plural super blocks) each composed of plural blocks (plural physicalblocks), to increase the write/read speed. The flash storage device 3can execute in parallel the write operation and the read operation forthe plural blocks included in a certain parallel unit (super block).

However, since several defective blocks are included in the NAND flashmemory die, each of the defective blocks in the parallel unit is oftenreplaced with the other block to secure the degree of parallel. However,if the number of defective blocks included in one NAND flash memory dieis increased, the information amount for management of the replacementmay be increased.

For example, in a case where the number of blocks included in oneparallel unit is 64, to generate block addresses of each block from theblock addresses indicative of the parallel unit by a mathematical rule,if the fifteenth block of 64 blocks is replaced with the block of blockaddress 2049, at least 6 bits are required to represent the fifteenthnumber and 12 bits are required to represent 2049. As the number ofblocks need to be replaced is increased, the information amountproportional to the number is required. If the number of blocks to bereplaced is up to sixteen, the information of 18 bits×16=294 bits isrequired for each parallel unit.

In addition, in the data read operation, address translation fortranslating the address indicative of the defective block into theaddress indicative of the replacement destination block needs to beexecuted by using the replacement information. For this reason, if thenumber of defective blocks is increased, the time required for theaddress translation is increased in accordance with the increase inreplacement information, and the read latency is increased.

Thus, in the write operation for writing the data from the host 2, theflash storage device 3 selects the write destination block from theundefective blocks (normal blocks) in the parallel unit to be writtenwhile avoiding the defective blocks in the parallel, and determines thewrite destination location in this write destination block. The datafrom the host 2 is written to the write destination location. Then, theflash storage device 3 notifies the host 2 of the physical addressindicative of both of the write destination block and the write locationin the write destination block. Thus, since the host 2 can recognize theblock to which the write data has been actually written and the writedestination location in this block, the host 2 can transmit the readrequest to designate this physical address to the flash storage device 3if the data needs to be read. The flash storage device 3 can read thedata from the write destination location in the above-explained selectedblock, based on the physical address designated by this read request.Therefore, the address translation processing is unnecessary and theread latency can be reduced, in the flash storage device 3.

The global FTL of the host 2 may comprise a function of executing astorage service, a function of managing the lookup table (LUT), a wearcontrol function, a function of implementing high availability, ade-duplication function of preventing plural duplicated data portionshaving the same contents from being stored in a storage, and the like.

In contrast, the flash storage device 3 can execute low-levelabstraction (LLA). LLA is a function for abstraction of the NAND flashmemory. LLA includes a function of assisting the data placement. Thefunction of assisting the data placement includes a function ofdetermining the write destination location (block address and thelocation in this block) of the user data, a function of notifying anupper layer (host 2) of the physical address indicative of the writedestination location to which the user data is written, a function ofdetermining the copy source block and the copy destination block for thegarbage collection, a function of notifying the upper layer (host 2) ofthe copy destination location of the valid data, and the like. Inaddition, LLA also comprises a QoS control function of executingresource management of the flash storage device 3 for each domain (QoSdomain).

The QoS control function includes a function of determining the accessunit (data grain) for each QoS domain. The access unit is indicative ofthe minimum data size (data grain) which the host 2 can write/read. Theflash storage device 3 supports a single or plural access units (datagrains) and, if the flash storage device 3 supports the plural accessunits, the host 2 can instructs the access units (data grains) whichshould be used for each QoS domain to the flash storage device 3.

In addition, the QoS control function includes a function of preventingas much performance interference between the QoS domains as possible.This function is basically a function of maintaining stable latency.

To implement this, the flash storage devices 3 may logically divide theinside of the NAND flash memory into plural regions (plural QoSdomains). One region (i.e., one QoS domain) includes one or moreparallel units (super blocks). Each of the parallel units (super blocks)belongs to only one certain region (QoS domain).

FIG. 2 shows a hierarchical structure of the entire system including thehost 2 and the flash storage device 3.

In the host (server) 2, a virtual machine service 401 for providingplural virtual machines to plural end users is executed. In each of thevirtual machines on the virtual machine service 401, an operating systemand user applications 402 used by the corresponding end users areexecuted.

In addition, in the host (server) 2, plural I/O services 403corresponding to user applications 402 are executed. The I/O services403 may include LBA-based block I/O service, key-value store service,and the like. Each of the I/O services 403 includes a lookup table (LUT)which manages mapping between each of the logical addresses and each ofthe physical addresses of the flash storage device 3. The logicaladdress is indicative of an identifier (tag) which can identify data tobe accessed. The logical address may be the logical block address (LBA)which designates a location in the logical address space, a key of thekey-value store or a file identifier such as a file name.

In the LBA-based block I/O service, LUT which manages mapping betweeneach of the logical addresses (LBAs) and each or the physical addressesof the flash storage device 3 may be used.

In the key-value store service, LUT 411 which manages mapping betweeneach of the logical addresses (i.e., tags such as keys) and each of thephysical addresses indicative of the physical storage locations in theflash storage device 3 in which the data corresponding to the logicaladdresses (i.e., tags such as keys) are stored may be used. In the LUT,relationship between the tag, the physical address at which dataidentified by the tag is stored, and a data length of the data may bemanaged.

Each of the end users can select an addressing method (LBA, the key ofthe key-value store, the file identifier, or the like) which should beused.

Each LUT does not translate each of the logical addresses from the userapplication 402 into each of the logical addresses for the flash storagedevice 3, but translates each of the logical addresses from the userapplication 402 into each of the physical addresses of the flash storagedevice 3. In other words, each LUT is a table in which the table fortranslating the logical address for the flash storage device 3 into thephysical address and the application-level address translation table areintegrated (merged).

In the host (server) 2, the I/O service 403 exists for each of the QoSdomains. The I/O service 403 belonging to a certain QoS domain managesmapping between each of the logical addresses used by the userapplication 402 in the corresponding QoS domain and each of the physicaladdresses of the region allocated to the corresponding QoS domain.

Transmission of the command from the host (server) 2 to the flashstorage device 3 and return of a response of command completion or thelike from the flash storage device 3 to the host (server) 2 are executedvia an I/O queue 500 which exists in each of the host (server) 2 and theflash storage devices 3. The I/O queues 500 may also be classified intoplural queue groups corresponding to the QoS domains.

The flash storage device 3 comprises plural write buffers (WB) 601corresponding to the QoS domains, plural garbage collection (GC)functions 602 corresponding to the QoS domains, and the NAND flashmemories (NAND flash array) 603.

FIG. 3 shows a configuration example of the flash storage device 3.

The flash storage device 3 comprises a controller 4 and a nonvolatilememory (NAND flash memory) 5. The flash storage device 3 may comprise arandom access memory, for example, a DRAM 6.

The NAND flash memory 5 comprises a memory cell array comprising pluralmemory cells arranged in a matrix. The NAND flash memory 5 may be a NANDflash memory of a two-dimensional structure or a NAND flash memory of athree-dimensional structure.

The memory cell array of the NAND flash memory 5 includes plural blocksBLK0 to BLKm-1. Each of the blocks BLK0 to BLKm-1 is formed of a numberof pages (pages P0 to Pn-1 in this case). The blocks BLK0 to BLKm-1function as erase units. The blocks are often referred to as “eraseblocks”, “physical blocks” or “physical erase blocks”. Each of the pagesP0 to Pn-1 comprises plural memory cells connected to the same wordline. The pages P0 to Pn-1 are units for a data write operation and adata read operation.

The controller 4 is electrically connected to the NAND flash memory 5which is a nonvolatile memory, via a flash I/O control circuit 13 suchas toggle or open NAND flash interface (ONFI). The controller 4 is amemory controller (control circuit) configured to control the NAND flashmemory 5.

The NAND flash memory 5 comprises plural NAND flash memory dies. Thecontroller 4 manages the above-explained plural parallel units. Each ofthe parallel units is implemented by a super block which is a blockgroup including plural blocks (plural physical blocks) belonging todifferent NAND flash memory dies, respectively. The controller 4 canexecute in parallel the write operation and the read operation for theplural blocks included in each of the parallel units (super blocks).Each of the plural parallel units (super blocks) includes a unique superblock address (first block address). Each of the plural blocks in eachnonvolatile memory die includes a unique block address (second blockaddress). The block address of each of the blocks which should beincluded in each of the parallel unit (super blocks) is determined fromthe super block address of each parallel unit, based on a mathematicalrule.

The controller 4 comprises a host interface 11, a CPU 12, the flash I/Ocontrol circuit 13, a DRAM interface 14, and the like. The hostinterface 11, the CPU 12, the flash I/O control circuit 13, and the DRAMinterface 14 are interconnected via the bus 10.

The host interface 11 is a host interface circuit configured to performcommunication with the host 2. The host interface 11 may be, forexample, a PCIe controller (NVMe controller). The host interface 11receives various requests (commands) from the host 2. The requests(commands) include a write request (write command), a read request (readcommand), and the other various requests (commands).

The CPU 12 is a processor configured to control the host interface 11,the flash I/O control circuit 13, and the DRAM interface 14. The CPU 12loads a control program (firmware) from the NAND flash memory 5 or a ROM(not shown) to the DRAM 6 in response to power-on of the flash storagedevice 3 and executes various processing by executing the firmware. Thefirmware may be loaded into a SRAM in the controller 4, which is notillustrated in the drawings. The CPU 12 can execute command processingfor processing various commands from the host 2, and the like.Operations of the CPU 12 can be controlled by the above-describedfirmware executed by the CPU 12. A part or all parts of the commandprocessing may be executed by exclusive hardware in the controller 4.

The CPU 12 can function as a write operation control unit 21, a readoperation control unit 22, and a GC operation control unit 23. Anapplication program interface (API) for implementing the systemconfiguration shown in FIG. 2 is installed in the write operationcontrol unit 21, the read operation control unit 22, and the GCoperation control unit 23.

The write operation control unit 21 receives from the host 2 the writerequest (write command) designating the logical address (tag)identifying the data (user data) to be written. When the write operationcontrol unit 21 receives the write command, the write operation controlunit 21 first selects one block of undefective blocks included in theparallel unit (super block) to be written as a write destination block,by referring to a defect information management table 33. The defectinformation management table 33 holds defect information holding atleast 1-bit information indicative of being available or unavailable foreach of the blocks included in each of the parallel units (superblocks). The defect information corresponding to each of the superblocks may be a bit map including the same number of bits as the numberof blocks included in each of the super blocks. The write operationcontrol unit 21 can recognize whether each block in the parallel unit tobe written is a defective block or an undefective block, by referring tothe defect information (defect information management table 33)corresponding to the parallel unit (super block) to be written.

The defect information is not limited to the above-explained bit map,but information indicative of the number of erase cycles of each block(i.e., number of program/erase cycle) may be used instead as the defectinformation. In this case, the controller 4 may determine the blockhaving the number of erase cycles more than or equal to a certainthreshold value as the defective block.

The defective block is an unavailable block and is referred to as “badblock”. The defective block (bad block) indicated by the defectinformation may include the defective block (primary defective block)occurring in the process of manufacturing the NAND flash memory, thedefective block (grown defective block) occurring after the start of useof the flash storage device 3, or both of the primary defective blockand the grown defective block. The undefective block is an availableblock, i.e., a block except the defective block.

The write operation control unit 21 determines the write destinationlocation (page, and location in this page) in the selected writedestination block. Next, the write operation control unit 21 writes thedata (write data) from the host 2 to the write destination location ofthe write destination block. In this case, the write operation controlunit 21 can write not only the data from the host 2, but also both ofthe data and the logical address (tag) of the data to the writedestination block.

Then, the write operation control unit 21 returns to the host 2 thedesignated logical address (tag) and the physical address indicative ofboth of the write destination block and the write destination location.

In this case, the physical address may be represented by the dieidentifier, the physical block address (second block address), and theoffset. The die identifier is a unique identifier of each nonvolatilememory die. The die identifier included in the physical address isindicative of the die identifier of the nonvolatile memory die to whichthe write destination block belongs. The physical block address is ablock address (block number) for identifying each of the plural blocksin each nonvolatile memory die. The block address included in thephysical address is indicative of the block address of the writedestination block. The offset is an in-block offset. The offset includedin the physical address is indicative of an offset (offset value) fromthe leading part of the write destination block to the write destinationlocation. This offset may be represented by the page address of the pageto which the write destination location belongs, and the in-page offsetcorresponding to the write destination location.

Alternatively, the physical address may be represented the super blockaddress (first block address) and the offset. The super block address isa unique block address of each super block. The super block addressincluded in the physical address is indicative of the super blockaddress of the super block to be written. The offset is indicative of anoffset (offset value) from the leading part of the super block to bewritten to the write destination location. This offset may berepresented by the die identifier of the nonvolatile memory die to whichthe write destination block belongs, the page address of the page towhich the write destination location belongs, and the in-page offsetcorresponding to the write destination location.

The physical address is also referred to as “flash address”.

The write command may not designate the only logical address (tag), butmay designate the super block address. If the write operation controlunit 21 receives the write command to designate the super block address,the write operation control unit 21 selects the super block having thesuper block address designated by the write command, of the plural superblocks, as the parallel unit (write destination super block) to bewritten.

If the read operation control unit 22 receives the read request (readcommand) designating the physical address (indicative of the block to beread and the location to be read in the block) from the host 2, the readoperation control unit 22 reads the data from the location to be read,in the block to be read, based on this physical address.

When the GC operation control unit 23 executes the garbage collection ofthe NAND flash memory 5, the GC operation control unit 23 selects thecopy source block (GC source block) and the copy destination block (GCdestination block) for the garbage collection from the plural blocks inthe NAND flash memory 5. Each of the GC source block and the GCdestination block may be a super block or a physical block.

The GC operation control unit 23 generally selects plural copy sourceblocks (GC source blocks) and at least one copy destination block (GCdestination block). A condition (GC policy) for selecting the copysource blocks (GC source blocks) may be designated by the host 2. Forexample, a GC policy of selecting the block in which the valid dataamount is the smallest as the copy source block (GC source block) inpriority may be used or the other GC policy may be used. Thus, theselection of the copy source block (GC source block) and the copydestination block (GC destination block) is executed by not the host 2,but the controller 4 (GC operation control unit 23) of the flash storagedevice 3. The controller 4 may manage the valid data amount of each ofthe blocks by using each of the block management blocks.

Management of valid data/invalid data may be executed by using the blockmanagement table 32. The block management table 32 may exist, forexample, for each of the super blocks. In the block management table 32corresponding to a certain super block, a bit map flag indicative ofvalidity/invalidity of the data in each block in this super block isstored. The valid data as used herein means data which is referred tofrom the LUT (i.e., data linked to a certain logical address as thelatest data) and may subsequently be read by the host 2. The invaliddata means data which no longer has a possibility of being read from thehost 2. For example, data associated with a certain logical address isvalid data, and data unassociated with logical address is invalid data.

The GC operation control unit 23 determines a location (copy destinationlocation) in the copy destination block (GC destination block) to whichthe valid data stored in the copy source block (GC source block) shouldbe written, and copies the valid data to the determined location (copydestination location) of the copy destination block (GC destinationblock). In this case, the GC operation control unit 23 may copy both ofthe valid data and the logical address of the valid data to the copydestination block (GC destination block). The GC operation control unit23 may specify the valid data in the GC source block by referring to theblock management table 32 corresponding to the copy source block (GCsource block). Alternatively, the host 2 may designate the GC sourceblock and the GC destination block, in the other embodiments. The GCsource block and the GC destination block may be super blocks orphysical blocks.

Then, the GC operation control unit 23 notifies the host 2 of thelogical address (tag) of the copied valid data, the physical addressindicative of the previous physical storage location of the copied validdata, and the physical address indicative of the new physical storagelocation of the copied valid data.

In the present embodiments, as explained above, the write operationcontrol unit 21 can write both of the data (write data) from the host 2and the logical address (tag) from the host 2 to the write destinationblock. For this reason, since the GC operation control unit 23 caneasily acquire the logical address of each of the data in the copysource block (GC source block) from the copy source block (GC sourceblock), the GC operation control unit 23 can easily notify the host ofthe logical address of the copied valid data.

The flash I/O control circuit 13 is a memory control circuit configuredto control the NAND flash memory 5 under the control of the CPU 12. TheDRAM interface 14 is a DRAM control circuit configured to control theDRAM 6 under the control of the CPU 12. A part of a storage region ofthe DRAM 6 is used to store a read buffer (RB) 30, a write buffer (WB)31, the block management table 32, and the defect information managementtable 33. The read buffer (RB) 30, the write buffer (WB) 31, thein-block LUT 32, and the block management table 32 may be stored in SRAM(not shown) in the controller 4.

Next, API used as a software interface between the flash storage devices3 and the host 2 will be explained. In the embodiments, the APIs areroughly classified into In-Drive-GC API and super block API.

In-Drive-GC API includes a command group based on a feature that theflash storage device 3 executes the garbage collection (GC) by itself.The command group may include as basic commands, a write command (Writewithout Physical Address), a read command (Read with Physical Address),a Trim command (Trim), a duplication command (Duplicate), an addressupdate notification (Address Update Notification (Device Initiated)), aforced GC command (Forced Garbage-Collection), a GC control command(Garbage Collection Control), and the like.

The write command (Write without Physical Address) is a write commandwhich designates the logical address (tag) identifying the user data tobe written and which does not designate the physical address of thewrite destination.

The read command (Read with Physical Address) is a read command whichdesignates the physical address indicative of the physical storagelocation to be read (i.e., the physical block to be read and thelocation to be read in the physical block).

The trim command (Trim) is a command which designates the physicaladdress of the data to be invalidated and which instructs the storagedevice 3 to invalidate the data corresponding to the physical address.If the host 2 support the de-duplication function of preventing theplural duplicated data portions having the same contents from beingstored in the storage, the trim command (Trim) is used as a commandinstructing the storage device 3 to decrease a reference countindicative of the number of the logical addresses referring to certaindata. The duplication command (Duplicate) is used as a command forinstructing the storage device 3 to increase the reference countindicative of the number of the logical addresses referring to certaindata.

The Address Update Notification (Device Initiated) is used to permit thestorage device 3 to notify the host 2 of the logical address of thecopied data (valid data), the previous physical storage location of thevalid data, and a new physical storage location of the valid data afterthe data copy operation for GC is executed by the flash storage device3.

The forced GC command (Forced Garbage-Collection) is a command forforcing the flash storage device 3 to execute GC.

The GC control command (Garbage Collection Control) is a command forinstructing the condition for starting the GC, and the like to the flashstorage device 3.

FIG. 4 shows an example of parameters and return values of therespective commands for In-Drive-GC API.

In. FIG. 4, contents described subsequently with label “Host:” areparameters designated by the corresponding commands, and contentsdescribed subsequently with label “Device:” are parameters (returnvalues) included in the response to this command.

The write command (Write without Physical Address) may include the useraddress, the length, the data, and the QoS domain identifier. The useraddress is the logical address (tag) for identifying the data whichshould be read. Each of the user addresses includes LBA, the key of thekey-value store, the file identifier, and the like.

The response to the write command may include status (success/failure),the user address, flash address (physical address), the length, and theremaining writable data amount (distance-to-block-boundary). Theremaining writable data amount (distance-to-block-boundary) is anoptional return value, which is indicative of the remaining data amountwritable to the super block to which the data is written. The remainingwritable data amount (distance-to-block-boundary) may be represented bya multiple of the grain of the above-explained data. The data is oftenwritten across two undefective blocks before and after the defectiveblock. For this reason, the response to the write command may includeplural sets each including the user address, flash address (physicaladdress), and the length.

The read command (Read with Physical Address) may include the flashaddress and the length. The read command (Read with Physical Address)may include plural sets each including the flash address and the length.The response to the read command may include the status, the useraddress, the length, the data, and the like. The response to the readcommand may include plural sets each including the user address and thelength. The trim command (Trim)/duplication command (Duplicate) mayinclude the flash address, the length, and the amount of increase anddecrease of the reference count (reference-count-to-add-or-subtract).The trim command (Trim)/duplication command (Duplicate) may includeplural sets each including the flash address, the length, and the amountof increase or decrease of the reference count.

The Address Update Notification (Device Initiated) may include the useraddress, the previous flash address, the new flash address, thereference count, and the length as output parameters of which the host 2is notified by the flash storage device 3. For example, the flashstorage device 3 transmits the Address Update Notification (Deviceinitiated) to host 2 after copying the data from the previous physicalstorage location to the new physical storage location. The AddressUpdate Notification (Device Initiated) may include the user address ofthe data, the previous flash address indicative of the previous physicalstorage location of the data, the new flash address indicative of thenew physical storage location of the data, the reference countindicative of the number of logical addresses referring to the data, andthe length of the data. The address update notification (Address UpdateNotification (Device Initiated)) may include plural sets each includingthe user address, the previous flash address, the new flash address, thereference count, and the length.

The forced GC command (Forced Garbage-Collection) may include the QoSdomain identifier and a source super block address (optional).

The GC control command (Garbage Collection Control) may include themaximum number of the data to be copied (maximum-number-of-data), theQoS domain identifier, and the GC method (policy).

The super block API includes command groups based on a feature that thehost 2 designates the logical address (tag) and the super block addressand the flash storage device determines the write destination block inthe super block and the write destination location in the writedestination block. The command groups include as basic commands, a writecommand (Write without Page Address), a read command (Read with PhysicalAddress), a super block release command (Release Super Block to UnusedSuper Block Pool), a super block allocate command (Allocate Super Blockand Open Write Buffer with Block Healing), a close super block command(Close Super Block and Write Buffer), a super block information command(Super Block Information), a non-copy data set command (Set Data not tobe Copied), a data copy command (Data Copy without Page Address), andthe like.

The write command (Write without Page Address) is a write command whichdesignates the logical address (tag) and the super block address. Theread command is the same as the read command for In-Drive-GC API. Thesuper block release command (Release Super Block to Unused Super BlockPool) is a command for releasing the already allocated super block. Thesuper block allocate command (Allocate Super Block and Open Write Bufferwith Block Healing) is a command for requesting allocation of the superblock. The super block allocate command (Allocate Super Block and OpenWrite Buffer with Block Healing) may include a parameter designating aparallel number indicative of the number of blocks capable of parallelaccess. The super block information command (Super Block Information) isa command for obtaining information on a specific super block. Thenon-copy data set command (Set Data not to be Copied) is a command fordesignating the data which should not be copied in the super block. Thedata copy command (Data Copy without Page Address) is a command forcopying data for GC. Examples of the parameters and return values ofthese commands are shown in FIG. 5. In FIG. 5, too, contents describedsubsequently with label “Host:” are indicative of parameters designatedby the corresponding commands, and contents described subsequently withlabel “Device:” are indicative of parameters (return values) included inthe response to this command.

FIG. 6 shows a relationship between the flash I/O control circuit 13 andthe plural NAND flash memory dies.

As illustrated in FIG. 6, the NAND flash memory 5 comprises the pluralNAND flash memory dies. Each of the NAND flash memory dies is anonvolatile memory die comprising a memory cell array comprising pluralblocks (physical blocks) BLK and a peripheral circuit which controls thememory cell array. The individual NAND flash memory dies can operateindependently. Thus, the NAND flash memory dies function as minimumparallel operation units. The NAND flash memory dies are referred to as“NAND flash memory chips” or “nonvolatile memory chips”. FIG. 6illustrates a case where sixteen channels Ch0, Ch1, . . . Ch15 areconnected to the flash I/O control circuit 13 and the same number (forexample, one die per channel) of NAND flash memory dies are connected toeach of the channels Ch0, Ch1, . . . Ch15. Each of the channelscomprises a communication line (memory bus) for communication with thecorresponding NAND flash memory dies.

The controller 4 controls NAND flash memory dies #0 to #15 via thechannels Ch0, Ch1, . . . Ch15. The controller 4 can simultaneously drivethe channels Ch0, Ch1, . . . Ch15.

In the configuration example shown in FIG. 6, a maximum of sixteen NANDflash memory dies can be operated in parallel.

In the present embodiments, the controller 4 manages plural parallelunits (super blocks) each of which is composed of plural blocks BLK. Thesuper blocks are not limited to these but may include a total of sixteenblocks BLK selected from the NAND flash memory dies #0 to #15 connectedto different channels. Each of the NAND flash memory dies #0 to #15 mayhave a multi-plane configuration. For example, if each of the NAND flashmemory dies #0 to #15 has the multi-plane configuration including twoplanes, one super block may include a total of thirty-two blocks BLKselected from thirty-two planes corresponding to the NAND flash memorydies #0 to #15, respectively.

FIG. 7 illustrates a case where one super block SB is composed of atotal of sixteen blocks BLK selected from the NAND flash memory dies #0to #14,respectively. The one super block SB includes one block selectedfrom the blocks in the NAND flash memory dies #0, one block selectedfrom the blocks in the NAND flash memory dies #1, one block selectedfrom the blocks in the NAND flash memory dies #2, . . . one blockselected from the blocks in the NAND flash memory dies #15. In theoperation of writing data to the super block SB, the data are written inorder of page P0 of the block BLK in the NAND flash memory die #0, pageP0 of the block BLK in the NAND flash memory die #1, page P0 of theblock BLK in the NAND flash memory die #2, . . . page P0 of the blockBLK of the NAND flash memory die #15, page P1 of the block BLK in theNAND flash memory die #0, page P1 of the block BLK in the NAND flashmemory die #1, page P1 of the block BLK in the NAND flash memory die #2,. . . page P1 of the block BLK in the NAND flash memory die #15, . . .

FIG. 8 shows a relationship between block address (super block address)of the super block SB and block address in each of the plural blocks(physical blocks) constituting the super block SB.

The block address of each of the blocks (physical blocks) which shouldbe included in the super block SB is determined from the block address(super block address) of the super block SB, based on a mathematicalrule.

For example, a value obtained by subjecting the super block addresses ofthe super block SB to predetermined four arithmetic operations may bedetermined as the block address of each of the blocks which should beincluded in the super block SB. Alternatively, a value obtained bysubjecting plural bits indicative of the super block address of thesuper block SB to predetermined bit inversion or predetermined bit shiftmay be determined as the block address of each of the blocks whichshould be included in the super block SB.

FIG. 8 shows an example that the super block SB is composed of theblocks having the same block addresses as the super block address of thesuper block SB, to simplify the illustration.

Superblock SB0 having super block address 0 is composed of block BLK0 ofblock address 0 included in the NAND flash memory die #0 (Die #0), blockBLK0 of block address 0 included in the NAND flash memory die #1 (Die#1), block BLK0 of block address 0 included in the NAND flash memory die#2 (Die #2) , . . . , block BLK0 of block address 0 included in the NANDflash memory die #15 (Die #15).

Similarly, super block SB1000 having super block address 1000 iscomposed of block BLK1000 of block address 1000 included in the NANDflash memory die #0 (Die #0), block BLK1000 of block address 1000included in the NAND flash memory die #1 (Die #1), block BLK1000 ofblock address 1000 included in the NAND flash memory die #2 (Die #2), .. . , block BLK1000 of block address 1000 included in the NAND flashmemory die #15 (Die #15).

Each Die often includes several defective blocks. In general, the numberof defective blocks is different in each Die.

FIG. 9 shows processing of replacing each of the defective blocks ineach Die with the other block belonging to the same Die.

In FIG. 9, it is assumed that each Die includes 2048 blocks BLK, thatDie #0 includes 100 defective blocks, that Die #1 does not include adefective block, that Die #2 includes 20 defective blocks, and that Die#15 includes 30 defective blocks.

In the Die #0, for example, defective block BLK2 is replaced withundefective block BLK1948 of the Die #0, and defective block BLK5 isreplaced with undefective block BLK1949 of Die #0. Thus, a total of 1948(=2048−100) blocks alone from the leading block of the Die #0 becomeavailable, and remaining blocks BLK1948 to BLK2047 of the Die #0 cannotbe used.

For this reason, even if Die #1 does not include a defective block,blocks BLK1948 to BLK2047 of the Die #1 become unavailable to constitutethe super blocks. The number of super blocks SB which can be constitutedis therefore limited to the number of undefective blocks in the Die #0including the most defective blocks.

FIG. 10 shows an operation of selecting a write destination block fromundefective blocks in a certain super block without replacing eachdefective block.

In FIG. 10, a certain super block (super block SB5 in this case) iscomposed of eight blocks, i.e., block BLK5 in Die#0, block BLK5 inDie#1, block BLK5 in Die#2, block BLK5 in Die#3, block BLK5 in Die#4,block BLK5 in Die#5, block BLK5 in Die#6, and block. BLK5 in Die#7, tosimplify the illustration.

In the embodiments, a defect information management table 33corresponding to each of the super blocks is provided. In the defectinformation management table 33 for super block SB5, defect information(bit map) including 1-bit information indicative of being available orunavailable for each block. In the defect information (bit map) , “0”represents an undefective block and “1” represents a defective block.

In FIG. 10, it is assumed that block BLK5 in Die#1, block BLK5 in Die#4,and block BLK5 in Die#5 are defective blocks.

The controller 4 does not execute processing of replacing block BLK5 inDie#1 with the other block in Die#1, processing of replacing block BLK5in Die#4 with the other block in Die#4, and processing of replacingblock BLK5 in Die#5 with the other block in Die#5. Instead, thecontroller 4 selects one block of the undefective blocks (block BLK5 inDie#0, block BLK5 in Die#2, block BLK5 in Die#3, block BLK5 in Die#6,and block BLK5 in Die#7) included in the super block SB5 as the writedestination block, by referring to the defect information managementtable 33 for super block SB5. The controller 4 determines the writedestination location in the write destination block, and writes thewrite data from the host 2 to the write destination location in thewrite destination block. Then, the controller 4 notifies the host 2 ofthe physical address indicative of both of the write destination blockand the write destination location.

Thus, since the host 2 can recognize the block (write destination block)to which the write data has been actually written and the writedestination location in this block, the host 2 can transmit a readrequest (read command) to designate the physical address of which thehost 2 is notified to the flash storage device 3 if the write data needsto be read. In other words, the host 2 first transmits the write request(write command) including the logical address (tag) identifying the datato be written to the flash storage device 3. The host 2 receives fromthe flash storage device 3 the physical address indicative of in both ofthe block selected from the blocks except the defective block as thewrite destination block and the write destination location (physicalstorage location) in this block, and the logical address (tag) of thisdata. The host 2 updates the lookup table (LUT) on the host 2 whichmanages mapping between each of the logical addresses (tags) and each ofthe physical addresses of the flash storage device 3, and maps thereceived physical address to the logical address (tag) identifying thisdata. If the host 2 needs to read this data, the host 2 obtains thephysical address mapped to the logical address (tag) of this data andtransmits the read request (read command) designating the obtainedphysical address, by referring the lookup table (LUT) on the host 2.

Thus, in the embodiments, data write and read operations for the superblock can be normally operated without replacing the defective block inthe super block to be written with the other block in the Die to whichthis defective block belongs. Therefore, even if the number of defectiveblocks is increased, a large amount of replacement information does notneed to be managed. In addition, since the address translationprocessing for replacement is also unnecessary, read latency can bereduced. Furthermore, since the same number of super blocks as thenumber of blocks belonging to each Die can be basically constructed,almost all of the undefective blocks can be used even if the number ofthe defective blocks is increased.

FIG. 11 shows the write command (Write without Physical Address) appliedto the flash storage device 3.

This write command is a command to request the flash storage device 3 towrite the data. This write command may include the command ID, the QoSdomain ID, the user address, the length, and the like as explainedabove.

The command ID is an ID (command code) indicating that this command isthe write command, and the command ID for the write command is includedin the write command.

The QoS domain ID is an identifier capable of uniquely identifying theQoS domain to which the data should be written. A write commandtransmitted from the host 2 in response to a write request from acertain end user may include the QoS domain ID designating the QoSdomain corresponding to the end user. The namespace ID may be handled asthe QoS domain ID.

The user address is the logical address (tag) identifying the data andcorresponds to, for example, LBA, the key, and the file identifier.

The length is indicative of the length of the write data to be written.The length may be designated by the number of LBA or its size may bedesignated by bytes.

FIG. 12 shows a response to the write command shown in FIG. 11.

This response includes the user address, flash address, the length, andthe remaining writable data amount (distance-to-block-boundary).

The user address is a user address included in the write command shownin FIG. 11.

The flash address is indicative of a physical address of a physicalstorage location in the NAND flash memory 5 to which data has beenwritten in response to the write command shown in FIG. 11.

In the present embodiments, the physical address is designated by, forexample, a combination of the die identifier, the block address, and theoffset (in-block offset), or a combination of the super block addressand the offset (offset in super block).

The length is indicative of the length of the written write data. Thelength may be designated by the number of LBA or its size may bedesignated by bytes.

The remaining writable data amount (distance-to-block-boundary) isindicative of the data amount writable to the super block to which thedata has been written.

FIG. 13 shows the Trim command applied to the flash storage device 3.

The Trim command includes the command ID, the flash address, the length,and the reference-count-to-subtract.

The command ID is an ID (command code) indicating that this command isthe Trim command, and the command ID for Trim command is included in theTrim command.

The flash address is indicative of a first physical storage locationwhere the data to be invalidated (data in which the reference countshould be decremented) is stored. In the present embodiments, the flashaddress is designated by a combination of the die identifier, the blockaddress, and the offset (in-block offset), or a combination of the superblock address and the offset (offset in super block).

The length is indicative of the length of the data to be invalidated(data in which the reference count should be decremented). This length(data length) may be designated by bytes.

The controller 4 manages a flag (bit map flag) indicative ofvalidity/invalidity of each of the data included in each of the pluralsuper blocks, by using the block management table 32. If the controller4 receives from the host 2 the Trim command including the flash addressindicative of the physical storage location in which the data to beinvalidated is stored, the controller 4 updates the block managementtable 32, and changes the flag (bit map flag) corresponding to the dataof the physical storage location corresponding to the flash addressincluded in the Trim command to a value indicative of invalidity.

In a case of supporting the de-duplication function, a reference countcorresponding to the data included in each of the plural super blocks ismanaged in the block management table 32. Thereference-count-to-subtract is indicative of the amount by which thereference count should be decremented.

Next, an operation of writing the data to the super block including adefective block will be explained with reference to FIG. 14.

To simplify the illustration, it is assumed that one certain super blockSB#0 is composed of four blocks BLK0 (Die#0), BLK0 (Die#1), BLK0(Die#2), and BLK0 (Die#3) and that BLK0 (Die#2) is a defective block.

The controller 4 writes the data in order of page 0 of block BLK0(Die#0), page 0 of block BLK0 (Die#1), page 0 of block BLK0 (Die#3),page 1 of block BLK0 (Die#0), page 1 of block BLK0 (Die#1), page 1 ofblock BLK0 (Die#3), . . . so as to avoid the defective block.

If the page size is 16K bytes (16 KB) and the grain of the data is 4Kbytes (4 KB), the first 16K-byte data (D1 to D4) are written to page 0of the block BLK0 (Die#0). Subsequent 16K-byte data (D5 to D8) arewritten to page 0 of the block BLK0 (Die#1). Write to BLK0 (Die#2) isskipped, and subsequent 16K-byte data (D9 to D12) are written to page 0of the block BLK0 (Die#3).

FIG. 15 shows a configuration example of the physical address includedin the response shown in FIG. 12.

As shown in an upper part of FIG. 15, the physical address is composedof the die identifier of the die to which the block selected as thewrite destination block belongs, the block address corresponding to theselected block, and the offset from a leading part of the selected blockto the write destination location. The offset from a leading part of theselected block to the write destination location includes the pageaddress and the in-page offset.

Alternatively, as shown in a lower part of FIG. 15, the physical addressis composed of the block address (super block address) corresponding tothe super block to which the write destination block belongs, and theoffset from a leading part of the super block to the write destinationlocation. The offset from a leading part of the super block to the writedestination location includes the die identifier, the page address andthe in-page offset.

FIG. 16 shows a relationship between a super block address (first blockaddress) of the super block and a block address (second block address)of each of the blocks included the super block.

To simplify the illustration, it is assumed that each of the superblocks SB0, SB1, and SB2 is composed of four blocks.

The super block SB0 includes blocks 80, 81, 82, and 83. Each of theblocks 80, 81, 82, and 83 includes the block address (second blockaddress) defined based on a mathematical rule from the super blockaddress (first block address) of the super block SB0. If the block 81 isa defective block, the data from the host 2 is written to the writedestination block selected from the blocks 80, 82, and 83. For thisreason, the second block address of the defective block 81 (dieidentifier of the die to which the defective block 81 belongs) does notreturn to the host 2.

The super block SB1 includes blocks 84, 85, 86, and 87. Each of theblocks 84, 35, 86, and 87 includes the block address (second blockaddress) defined based on a mathematical rule from the super blockaddress (first block address) of the super block SB1. If the blocks 86and 87 are defective blocks, the data from the host 2 is written to thewrite destination block selected from the blocks 84 and 85. For thisreason, the second block address of the defective block 86 (dieidentifier of the die to which the defective block 86 belongs) and thesecond block address of the defective block 87 (die identifier of thedie to which the defective block 87 belongs) do not return to the host2.

The super block SB2 includes blocks 88, 89, 90, and 91. Each of theblocks 88, 89, 90, and 91 includes the block address (second blockaddress) defined based on a mathematical rule from the super blockaddress (first block address) of the super block SB2. If the block 88 isa defective block, the data from the host 2 is written to the writedestination block selected from the blocks 89, 90, and 91. For thisreason, the second block address of the defective block 88 (dieidentifier of the die to which the defective block 88 belongs) does notreturn to the host 2.

FIG. 17 and FIG. 18 show an operation of writing a pair of the logicaladdress and the data to a page in the block.

In each of the blocks, each page may include a user data area forstoring the user data and a redundant region for storing the managementdata. The page size is over 16 KB.

The controller 4 writes both of 4 KB user data and the logical address(for example, LBA) corresponding to the 4 KB user data to the writedestination block BLK. In this case, as shown in FIG. 17, four data setseach including LBA and the 4 KB user data may be written to the samepage. The in-block offset may be indicative of the set boundary.

Alternatively, as shown in FIG. 18, four 4 KB user data may be writtento user data region in the page and four LBAs corresponding to these 4KB user data may be written to the redundant region in this page.

An operation of writing plural data portions and an erasure codecalculated from these data portions to the super block having adefective block will be explained with reference to FIG. 19.

To implement RAID system with the plural blocks in the super block, thecontroller 4 writes plural data portions and one or more erasure codescalculated from the plural data portions, across the plural pagesbelonging to the plural blocks included one super block and having thesame page address, as shown in FIG. 19. The plural pages belonging tothe plural blocks and having the same page address are referred to as asuper page.

It is illustrated in an upper part of FIG. 19 that the data and theerasure codes are written in the super page in the super block SB0. Thesuper page is composed of page 0 of block BLK0 (Die#0), page 0 of blockBLK0 (Die#1), page 0 of block BLK0 (Die#2), page 0 of block BLK0(Die#3), page 0 of block BLK0 (Die#4), page 0 of block BLK0 (Die#5),page 0 of block BLK0 (Die#6), and page 0 of block BLK0 (Die#7).

The data is written to each of the undefective blocks, i.e., BLK0(Die#0), BLK0 (Die#2), BLK0 (Die#3), and that BLK0 (Die#4).

An example of the erasure code includes Reed-Solomon code, parity, andthe like. The erasure codes are written to the pages in the undefectiveblocks. In addition, the erasure code is calculated by assuming that apredetermined value (for example, a bit string of all “0” or a bitstring of all “1”) is stored in a page of each defective block.

In the example shown in the upper part of FIG. 19, two erasure codes arewritten to the super page of the super block SB0. Two erasure codes arewritten to the pages in two last undefective blocks. In the exampleshown in the upper part of FIG. 19, since the last block BLK0 (Die#7) isthe undefective block, the second last block BLK0 (Die#6) is thedefective block, and the third last block BLK0 (Die#5) is theundefective block, two erasure codes are written to page 0 of block BLK0(Die#5) and page 0 of block BLK0 (Die#7).

In the encoding, the controller 4 calculates two erasure codes, based onthe data portion written to BLK0 (Die#0), a predetermined value (forexample, a bit string of all “0” or a bit string of all “1”) assumed tobe written to the defective block BLK0 (Die#0), the data portion writtento BLK0 (Die#2), the data portion written to BLK0 (Die#3), the dataportion written to BLK0 (Die#4), and a predetermined value (for example,a bit string of all “0” or a bit string of all “1”) assumed to bewritten to the defective block BLK0 (Die#6).

The erasure codes can be thereby easily calculated by the same operationfor encoding, irrespective of the pattern of defectiveblocks/undefective blocks in the super block.

In addition, the controller 4 executes decoding using the erasure codesby assuming that predetermined values are stored an the pages of therespective defective blocks.

In the example shown in the lower part of FIG. 19, since the last blockconstituting the super block SB1, i.e., BLK1 (Die#7) is the defectiveblock, the second last block BLK1 (Die#6) is the defective block, andthe third last block BLK1 (Die#5) is the undefective block, two erasurecodes are written to page 0 of block BLK1 (Die#5) and page 0 of blockBLK1 (Die#6).

Next, a relationship between a flash translation unit 2A in the host 2and the write operation control unit 21 in the flash storage device 3will be explained with reference to FIG. 20.

On the host 2 side, if the flash translation unit 2A executes datawrite, the flash translation unit 2A transmits to the flash storagedevice 3 a write command including Tag (for example, LBA) identifyingthe data. In a case where the flash translation unit 2A uses API forsuper block, the flash translation unit 2A transmits to the flashstorage device 3 the write command (Write without Page Address)designating the Tag (for example, LBA) identifying the data, and theblock address of the parallel unit. Since the parallel unit isimplemented by one super block, the block address of the parallel unitis the super block address of this super block.

The flash storage device 3 includes the write operation control unit 21,the flash I/O control circuit 13, the defect information managementtable 33, and the NAND flash memory dies. In the defect informationmanagement table 33, the defect information holding at least 1-bitinformation indicative of being available or unavailable for each blockin each super block is managed.

If the write operation control unit 21 receives from the host 2 side thewrite request including Tag (for example, LBA) to identify the data tobe written, the write operation control unit 21 selects one block fromthe undefective blocks included in one super block as the writedestination block, by referring to the defect information of the defectinformation management table 33, and determines the write destinationlocation (write destination page, offset in this page) in the selectedblock to which the data should be written.

If the write operation control unit 21 receives from the host 2 thewrite command designating the block address (super block address) of theparallel unit, the write operation control unit 21 selects the writedestination block from the undefective blocks included in the superblock having the designated block address (super block address), anddetermines the write destination location (write destination page,offset in this page) in the selected block to which the data should bewritten.

Then, the write operation control unit 21 transmits to the flash I/Ocontrol circuit 13 a write instruction designating the die identifier(Die ID) of the die to which the write destination block belongs, theblock address (Raw Block) of the write destination block, the writedestination page (Raw Page), and the offset (Offset) in the writedestination page.

In addition, the write operation control unit 21 notifies the host 2 ofthe flash addresses (Die ID, Raw Block, Raw Page, Offset) indicative ofboth of the write destination block and the write destination location,and Tag (for example, LBA).

The flash I/O control circuit 13 having received the write instructionwrites the data to the write destination location, based on the writeinstruction.

On the host 2 side, when the flash translation unit 2A receives theflash addresses (Die ID, Raw Block, Raw Page, Offset) and Tag (forexample, LBA) from the flash storage device 3, the flash translationunit 2A updates LUT managed by the host 2. At this time, the flashaddresses (Die ID, Raw Block, Raw Page, Offset) are associated with thisTag (for example, LBA).

When the flash translation unit 2A makes the read request, the flashtranslation unit 2A transmits the read request designating the flashaddresses (Die ID, Raw Block, Raw Page, Offset) to the flash storagedevice 3.

On the flash storage device 3 side, when the flash I/O control circuit13 receives the read request designating the flash addresses (Die ID,Raw Block, Raw Page, Offset) from the host 2, the flash I/O controlcircuit 13 reads the data, based on the flash addresses. The block to beread is specified by Die ID and Raw Block. The page to be read isspecified by Paw Page. The location to be read in the page to be read isspecified by Offset.

Next, the write operation and the read operation executed by the host 2and the flash storage device 3 will be explained with reference to FIG.21.

Write Operation (1) Reception of Write Command

In the flash storage device 3, the write command including LBA and thedata which are received from the host 2 are temporarily stored in thewrite buffer 31 in the flash storage device 3.

(2) Reference of Defective Information

The write operation control unit 21 selects one block from theundefective blocks included in the super block to be written as thewrite destination block, by referring to the defect information managedby the defect information management table 33, and determines the writedestination location in the write destination block.

(3) Instruction to Write

When the write operation control unit 21 determines the writedestination block and the write destination location in the writedestination block, the write operation control unit 21 transmits thewrite instruction of designating the flash address (Raw address)indicative of both of the write destination block and the writedestination block to the flash I/O control circuit 13 via the writebuffer 31. Die ID, Raw Block, Raw Page, and Offset are included in theRaw address. The flash I/O control circuit 13 having received the Rawaddress writes the write data to the write destination location in theblock selected as the write destination block.

(4) Notifying Host of Write Destination

The write operation control unit 21 notifies the host 2 of the Rawaddress and LBA. The host 2 can thereby update LUT and map this Rawaddress to the LBA.

Read Operation (11) Notifying LBA

When a read parser 2B receives the read command including LBA, the readparser 2B notifies the flash translation unit 2A of the LBA.

(12) Obtaining Raw Address

When the flash translation unit 2A receives the LBA from the read parser2B, the flash translation unit 2A obtains the Raw address correspondingto the received LBA and returns the obtained Raw address to the readparser 2B. Thus, the read parser 2B can obtain the Raw address andtranslate the read command including the LBA into the read commandincluding the Raw address.

(13) Read Instruction

The read parser 2B transmits the read command including the Raw addressto the flash storage device 3. In the flash storage device 3, the flashI/O control circuit 13 having received the read command including theRaw address reads the data, based on the Raw address, and transmits theread data to the read buffer 30. The read data is temporarily stored inthe read buffer 30.

(14) Transmission of Read Data to Host

The read data temporarily stored in the read buffer 30 is transmitted tothe host 2.

A sequence chart of FIG. 22 shows steps of the write operation executedby the host 2 and the flash storage device 3.

The host 2 transmits the write command (Write without Physical Address)including the QoS domain ID, the user address (logical address), writedata, and the length to the flash storage device 3. When the controller4 of the flash storage device 3 receives this write command, thecontroller 4 selects one block from the undefective blocks included inone super block (super block to be written) and determines the writedestination location in the selected block (step S11). In step S11, thesuper block to be written may be a super block belonging to the QoSdomain specified by the QoS domain ID. If plural super blocks belong tothe QoS domain, one of the plural super blocks is selected as the superblock to be written.

The controller 4 writes the write data received from the host 2 to thewrite destination location (step S12). In step S12, the controller 4writes both of the user address (for example, LBA) and the write data tothe write destination location in the write destination block.

The controller 4 updates the block management table 32, and changes abit map flag corresponding to the written data (i.e., a bit map flagcorresponding to the physical address of the physical location to whichthe data has been written) from 0 to 1 (step S13). It is assumed that asshown in FIG. 23, for example, 16K-byte update data in which start LBAis LBAx are written to the physical locations corresponding to offsets+0 to +3 of page 1 of block BLK#11. In this case, as shown in FIG. 24,each of the bit map flags corresponding to offsets +0 to +3 of page 1 ischanged from 0 to 1 in the block management table for block BLK11.

The controller 4 returns a response to the write command to the host 2(step S14). The user address, the physical address (flash address), andthe length are included in the response. For example, as shown in FIG.23, if the 16K-byte update data in which starting LBA is LBAx arewritten to the physical storage locations corresponding to offsets +0 to+3 of page 1 of block BLK11, the response including LBAx, the flashaddresses (die identifier of the die to which block BLK 11 belongs, theblock address of block BLK11, page address (=1), and in-page offset(=+0)), and the length (=4)) is transmitted from the controller 4 to thehost 2. The flash address is represented by a combination of the dieidentifier, the block address, the page address, and the in-page offsetbut, in the following explanations, explanation of the die identifier inthe flash address will be omitted to simplify the explanation of theflash address.

When the host 2 receives this response, the host 2 updates LUT managedby the host 2 and maps the flash address (physical address) to each ofthe user addresses corresponding to the written write data. As shown inFIG. 25, LUT includes plural entries corresponding to the respectiveuser addresses (logical addresses). In an entry corresponding to acertain user address (for example, certain LBA), the physical addressindicative of the location (physical storage location) in the NAND flashmemory 5 in which the data corresponding to the LBA is stored is stored.As shown in FIG. 23, if the 16K-byte update data in which starting LBAis LBAx are written to the physical storage locations corresponding tooffsets +0 to +3 of page 1 of block BLK11, the LUT is updated, BLK11,page and offset +0 are stored in the entry corresponding to LBAx, BLK11,page 1, and offset +1 are stored in the entry corresponding to LBAx+1,BLK11, page 1, and offset +2 are stored in the entry corresponding toLBAx+2, and BLK11, page 1, and offset +3 are stored in the entrycorresponding to LBAx+3 as shown in FIG. 25.

The host 2 then transmits the Trim command to invalidate previous datawhich become unnecessary due to write of the above update data, to theflash storage device 3. As shown in FIG. 23, if the previous data arestored in the locations corresponding to offset +0, offset +1, offset+2, and offset +3 of page 0 of block BLK0, the Trim command designatingthe flash addresses (block address (=BLK0), the page address (=page 0),and in-page offset (=+0)), and the length (=4)) is transmitted from thehost 2 to the flash storage device 3 as shown in FIG. 26. The controller4 of the flash storage device 3 updates the block management table 32 inresponse to the Trim command (step S15). In step S15, as shown in FIG.26, each of the bit map flags corresponding to offsets +0 to +3 of page0 is changed from 1 to 0 in the block management table for block BLK40.

FIG. 27 shows the read command (Read with Physical Address) applied tothe flash storage device 3.

The read command is a command to request the flash storage device 3 toread the data. The read command includes the command ID, the flashaddress, the length, and the transfer destination pointer.

The command ID is an ID (command code) indicating that this command isthe read command, and the command ID for the read command is included inthe read command.

The flash address is indicative of a lash address (physical address) ofa first physical storage location from which the data should be read.The length is indicative of the length of the data to be read.

The transfer destination pointer is indicative of the location on thememory in the host 2 to which the read data is to be transferred.

One read command can designate plural sets of the flash addresses(physical addresses) and the lengths.

In other word, the read command may include two or more sets of theflash addresses and the lengths. As an example case where the readcommand includes two or more sets of the flash addresses and thelengths, it is assumed a case that the write data is written to twoblocks that sandwich the defective block since the defective blockexists in the super block where data write has been executed.

FIG. 28 shows a read operation.

It is assumed here that the read command designating the block address(=BLK2), the page address (=page 1), the in-page offset (=+1), and thelength (=3) is received from the host 2. The controller 4 the flashstorage device 3 reads data d1 to d3 from BLK2, based on the blockaddress (=BLK2), the page address (=page 1), the in-page offset (=+1),and the length (=3). In this case, the controller 4 reads the data forone page size from page 1 of BLK2 and extracts data d1 to data d3 fromthe read data. Next, the controller 4 transfers data d1 to data d3 on ahost memory designated by a transfer destination pointer.

A sequence chart of FIG. 29 shows steps of the read operation executedby the host 2 and the flash storage device 3.

The host 2 translates the user address (logical address) included in theread request from the user application into the flash address, byreferring to LUT managed by the host 2. Then, the host 2 transmits theread command designating the flash address and the length to the flashstorage device 3.

When the controller 4 of the flash storage device 3 receives the readcommand from the host 2, the controller 4 determines the block to beread, the page to be read, and the in-page location to be read, based onthe flash address designated by the read command (step S31). Thecontroller 4 reads the data defined by the flash address and the lengthfrom the NAND flash memory 5 (step S32) and transmits the read data tothe host 2.

FIG. 30 shows a garbage collection (GC) control command applied to theflash storage device 3.

The GC control command may include the command ID, the policy (method ofGC), the QoS domain ID, the maximum number of data(maximum-number-of-data), and the like.

The command ID is the ID (command code) indicating that this command isthe GC control command, and the command ID for the GC control command isincluded in the GC control command.

The policy (method of GC) is the policy indicating the condition (GCpolicy) for selecting the GC candidate block (GC source block). Thecontroller 4 of the flash storage device 3 supports plural GC policies.

The GC policy supported by the controller 4 may include a policy(greedy) that the block of a small valid data amount is selected withpriority as the GC candidate block (GC source block).

In addition, the GC policy supported by the controller 4 may include apolicy that the block in which data (cold data) of a low updatefrequency are collected is selected as the GC candidate block (GC sourceblock) with higher priority than the block in which data (hot data) of ahigh update frequency are collected.

Furthermore, the GC policy may designate the GC start condition. The GCstart condition may be indicative of, for example, the number of theremaining free blocks.

The controller 4 manages the super blocks including the valid data bythe active block list and, if GC is executed, the controller 4 mayselect at least one GC candidate super block (GC source block) from thesuper blocks managed by the active block is based on the GC policydesignated by the GC control command.

The QoS domain ID is a parameter designating the QoS domain where GCshould be executed. The controller 4 selects at least one GC candidatesuper block (GC source block) from the super blocks belonging to the QoSdomain designated by the QoS domain ID, i.e., the active block listcorresponding to the QoS domain.

The maximum number of data is indicative of the upper limit of the dataamount copied in executing the GC. In other words, the GC operation isexecuted until the amount of the valid data which is copied reaches tothe maximum number of data. If the amount of the valid data which iscopied reaches to the maximum number of data, the GC operation isstopped.

If the number of remaining free blocks corresponding to the QoS domainsis smaller than equal to a threshold value designated by the policy, thecontroller 4 may start GC.

FIG. 31 shows a forced GC command (Forced Garbage-Collection) applied tothe flash storage device 3.

The forced GC command may include the command ID, the QoS domain ID, thesuper block address, and the like. When the controller receives theforced GC command, the controller executes the GC immediately.

FIG. 32 is shows an address update notification (Address UpdateNotification (Device Initiated)) transmitted from the flash storagedevice 3 to the host 2.

The address update notification is executed to notify the host 2 of thestorage location of the data which have been changed by executing the GCoperation in the flash storage device 3. The address update notificationmay include the user address, the previous flash address, the new flashaddress, the reference count, the length, and the like.

The user address is an address for identifying the a copied data.

The previous flash address is indicative of a physical address (previousphysical address) of the previous physical storage location where thecopied data are stored

The new flash address is indicative of a physical address (new physicaladdress) of the new physical storage location where the copied data arestored.

The reference count is indicative of the number of user addressesreferring to the copied data.

The length is indicative of the length of the copied data.

A sequence chart of FIG. 33 shows steps of the GC operation executed bythe flash storage device 3.

The controller 4 of the flash storage device 3 selects one or more GCsource blocks (GC source super blocks) where the valid data and invaliddata exist together, from the super blocks belonging to the QoS domaindesignated by the host 2 (step S41). Next, the controller 4 selects oneor more free blocks (free super blocks) from the free blocks (free superblocks) belonging to the QoS domain, and allocates the selected freeblock as the GC destination block (GC destination super block) (stepS42).

The controller 4 copies all of the valid data in the GC source block (GCsource super block) to the GC destination block (GC destination superblock) (step S43). In step S43, the controller 4 does not copy only thevalid data in the GC source block (GC source super block), but copiesboth of the valid data and the user address (logical address)corresponding to the valid data from the GC source block (GC sourcesuper block) to the GC destination block (GC destination super block). Apair of the data and the user address (logical address) can be therebyheld in the GC destination block (GC destination super block).

Then, the controller 4 notifies the host 2 of the user address (logicaladdress), the previous flash address, the new flash address, and thelength for each copied valid data, by using the address updatenotification (step S44).

When the host 2 receives the address update notification, the host 2updates LUT managed by the host 2 and maps the new flash address to theuser address (logical address) corresponding to each copied valid data(step S51).

FIG. 34 shows an example of a data copy operation executed for GC.

In FIG. 34, it assumed that the valid data (LBA=10) stored in thelocation corresponding to offset +0 of page 1 of the GC source block(block BLK50 in this case) is copied to the location corresponding tooffset +0 of page 0 of the GC destination block (block BLK100 in thiscase) and that the valid data (LBA=20) stored in the locationcorresponding to offset +2 of page 2 of the GC source block (blockBLK50) is copied to the location corresponding to offset +1 of page 0 ofthe GC destination block (block BLK100 in this case). In this case, thecontroller 4 notifies the host 2 of {LBA10,previous flash address(BLK50, page 1, offset (=+0)), new flash address (LBA100, page 0, offset(=+0)), length (=1) } and {LBA20, previous flash address (BLK50, page 2,offset (=+2)), new flash address (LBA100, page 0, offset. (=+1)), length(=1) } (address update notification).

FIG. 35 shows contents of LUT 411 of the host 2 updated based on aresult of the data copy operation shown in FIG. 34.

In the LUT, the flash address (block address, page address, and offset(in-page offset)) corresponding to LBA 10 is updated from BLK50, page 1,and offset (=+0) to BLK100, page 0, and offset (=+0). Similarly, theflash address (block address, page address, and offset (in-page offset))corresponding to LBA 20 is updated from BLK50, page 2, and offset (=302) to BLK100, page 0,and offset (=+1).

After LUT is updated, the host 2 may transmit the Trim commanddesignating BLK50, page 1, and offset (=+0) to the flash storage device3 and invalidate the data stored in the location corresponding to offset(=30 0) of page 1 of BLK50. Furthermore, the host 2 may transmit theTrim command designating BLK50, page 2, and offset (=+2) to the flashstorage device 3 and invalidate the data stored in the locationcorresponding to offset (=+2) of page 2 of BLK50.

FIG. 36 shows a relationship between the response to the write commandand the callback processing for GC (address update notification).

During a time period in which the controller 4 is copying the valid datacorresponding to a certain user address (logical address), the writecommand designating this user address may be received from the host 2.

In FIG. 36, it is assumed that the write command designating LBA10 isreceived from. the host 2 during execution of the data copy operation(data copy operation corresponding to LBA10) shown in FIG. 34.

The controller 4 writes the write data received from the host 2 to thewrite destination block (i.e., to the location corresponding to offset+0 of page 0 of BLK3). Then, the controller 4 returns {LBA10, BLK3, page0, offset (=+0)} to the host 2 as the response to the write command.

The host 2 updates the LUT, and changes the block address, the pageaddress, and the offset (in-page offset) corresponding to LBA 10 fromBLK50, page 1, and offset (=+0) to BLK3, page 0, and offset (=+0).

After this, if the controller 4 notifies the host 2 of the new flashaddress corresponding to LBA 10, the latest flash address (BLK3, page 0,and offset (+0) indicative of the location where the latest datacorresponding to LBA 10 is stored may be erroneously changed to the newflash address (BLK100, page 0, and offset (+0) in this case)corresponding to LBA 10.

In the present embodiments, the controller 4 can notify the host 2 ofnot only LBA 10 and the new flash address (BLK100, page 0,and offset(+0)) and the length=1), but also the previous flash address (BLK50,page 1, and offset (+0)) (address update notification). If the previousflash address (BLK50, page 1, and offset (+0)) does not match the blockaddress, the page address, and the offset currently mapped to LBA 10 byLUT, the host 2 does not update LUT. The block address, the pageaddress, and the offset (BLK3, page 0,and offset (+0)) indicative of thelocation where the latest data corresponding to LBA 10 is stored can bethereby prevented from being erroneously changed to the new flashaddress (BLK100, page 0, and offset (+0) in this case) corresponding toLBA 10.

A flowchart of FIG. 37 shows steps of the LUT update processing executedby the host 2.

If the host 2 receives the address update notification (YES in stepS101), the host 2 compares the previous flash address with the currentphysical address on the LUT (step S102). If the previous flash addressmatches the current physical address as a result of comparison (YES instep S103), the host 2 updates the current physical addresscorresponding to the user address to the new flash address (step S104).Next, the host 2 transmits the Trim command to the flash storage deviceand invalidates the data stored in the location corresponding to theprevious flash address (step S105).

In contrast, if the previous flash address does not match the currentphysical address (NO in step S106), the host 2 maintains the currentphysical address corresponding to the user address (step S106). Theblock address, the page address, and the offset indicative of thelocation where the latest data is stored can be thereby prevented frombeing erroneously changed to the new flash address.

An example of the block management table for block BLK1 is shown in FIG.38.

The block management table for block BLK1 includes plural entriescorresponding to respective sets of the page addresses and in-pageoffsets of block BLK1.

For example, the reference count corresponding to 4 KB data stored inthe location corresponding to page 0 of block BLK1 and offset +0 of page0 is stored in the entry corresponding to page 0 and offset +0.Similarly, the reference count corresponding to 4 KB data stored in thelocation corresponding to page 0 of block BLK1 and offset +1 of page 0is stored in the entry corresponding to page 0 and offset +1.

Data in which the reference count is 1 or more is valid data, and datain which the reference count is 0 is invalid data.

The flash storage device 3 increments/decrements the reference count,based on the duplicate command/Trim command received from the host 2.

FIG. 39 shows a duplicate command applied to the flash storage device 3in order to manage the reference count.

The duplicate command is a command to request the flash storage device 3to increment the reference count of the data stored in a certainphysical address (block address, page address, and in-page offset).

The duplicate command may include the command ID, the flash address, thelength, and the like.

The command ID is an ID (command code) indicating that this command isthe duplicate command, and the command ID for the duplicate command isincluded in the duplicate command.

The flash address is indicative of a first physical storage locationwhere the data in which the reference count should be incremented isstored.

The length is indicative of the length of the data in which thereference count should be incremented.

If the controller 4 receives the duplicate command including the blockaddress, the page address, and the in-page offset indicative of thephysical location where the data in which the reference count should beincremented is stored, from the host 2, the controller 4 updates theblock management table 32, and increments the reference countcorresponding to the data of the physical location corresponding to theblock address, the page address, and the in-page offset included in theduplicate command.

A sequence chart of FIG. 40 shows reference count increment/decrementprocessing.

When the controller 4 of the flash storage device 3 receives theduplicate command from the host 2, the controller 4 increments thereference count corresponding to the flash address (block address, pageaddress, and offset (in-page offset)) designated by the duplicatecommand, i.e., the reference count corresponding to the data stored inthe physical storage location in the NAND flash memory 5 designated bythe block address, the page address, and the offset, by 1 (step S61). Inthis case, the controller 4 updates the block management table 32corresponding to the block having the block address designated by theduplicate command. In updating of the block management table 32, thereference count stored in the entry in the block management table 32corresponding to the physical storage location designated by theduplicate command is incremented by, for example, 1. If the lengthdesignated by the duplicate command is 2 or more, not only the referencecount corresponding to the page address and the offset designated by theduplicate command, but also the reference counts corresponding toseveral page addresses and offsets following the page address and theoffset are incremented by, for example, 1.

When the controller 4 of the flash storage device 3 receives the Trimcommand from the host 2, the controller 4 decrements the reference countcorresponding to the flash address (block address, page address, andoffset (in-page offset)) designated by the Trim command, i.e., thereference count corresponding to the data stored in the physical storagelocation in the NAND flash memory 5 designated by the block address, thepage address, and the offset, by 1 (step S62). In this case, thecontroller 4 updates the block management table 32 corresponding to theblock having the block address designated by the Trim command. Inupdating of the block management table 32, the reference count stored inthe entry in the block management table 32 corresponding to the pageaddress and the offset designated by the Trim command is decremented by,for example, 1.If the length designated by the Trim command is 2 ormore, not only the reference count corresponding to the page address andthe offset designated by the Trim command, but also the reference countscorresponding to several page addresses and offsets following the offsetare decremented by, for example, 1.

In GC, the controller 4 refers to the block management tablecorresponding to the GC source block and determines whether the data inthe GC source block is valid data or invalid data in the data unithaving the size of 4 KB. The controller 4 determines that the data inwhich the reference count is 0 is invalid data and that the data inwhich the reference count is 1 or more is valid data. Then, thecontroller 4 copies the valid data (i.e., the data in which thereference count is 1 or more) and the logical address corresponding tothe valid data from the GC source block (GC source super block) to theGC destination block (GC destination super block).

More specifically, if the controller 4 executes the garbage collectionof the NAND flash memory 5, the controller 4 selects the GC source block(GC source super block) and the GC destination block (GC destinationsuper block) for garbage collection. The controller 4 copies both of thefirst data (valid data) in which the reference count is 1 or more andthe logical address of the first data, which are stored in the GC sourceblock (GC source super block), to the GC destination block (GCdestination super block). Then, the controller 4 notifies the host 2 ofthe user address (logical address) of the first data, the physicaladdress of the copy destination physical storage location (new physicalstorage location) of the first data, and the physical address of thecopy source physical storage location (previous physical storagelocation) of the first data.

A flowchart of FIG. 41 shows steps of the super block allocatingprocessing executed by the flash storage device 3.

If the controller 4 receives a super block allocate request (parallelunit allocate request) from the host 2 (YES in step S71), the controller4 selects the super block including a more number of undefective blocksthan the parallel number designated by the allocate request (step S72).

Next, the controller 4 allocates the selected super block to the host 2(step S73).

Then, if the controller 4 receives the write request from the host 2(YES in step S74), the controller 4 writes the write data to theundefective block in the allocated super block (step S75) controller 4returns a response to the host 2 (step S76).

Next, an address translating operation of translating an address of theblock to be accessed such that all undefective blocks in the super blockare logically arranged sequentially from a leading part of the superblock will be explained with reference to FIG. 42.

In FIG. 42, super block SB5 is composed of BLK5 (Die#0), BLK5 (Die#1),BLK5 (Die#2), BLK5 (Die#3), BLK5 (Die#4), BLK5 (Die#5), BLK5 (Die#6),and BLK5 (Die#7), and BLK5 (Die#2) and BLK5 (Die#5) are defectiveblocks. In addition, it is assumed that BLK5 (Die#0), BLK5 (Die#1), BLK5(Die#2), BLK5 (Die#3), BLK5 (Die#4), BLK5 (Die#5), BLK5 (Die#6), andBLK5 (Die#7) are designated from the outside by block numbers (blockaddresses) 0, 1, 2, 3, 4, 5, 6, and 7, respectively.

The address translation is executed such that six undefective blocks insuper block SB5, i.e., BLK5 (Die#0), BLK5 (Die#1), BLK5 (Die#3), BLK5(Die#4), BLK5 (Die#6), and BLK5 (Die#7) are designated from the outsideby block numbers (block addresses) 0 to 5,respectively.

If the address translation operation is executed, the block numbers ofrespective BLK5 (Die#0), BLK5 (Die#1), BLK5 (Die#2), BLK5 (Die#3), andBLK5 (Die#4) are translated in manners of 0→0, 1→1, 2→3, 3→4, 4→6, and5→7. Including the block numbers of the defective blocks in thesequential offset addresses starting from the leading part of the superblock SB5 can be prevented by this address translation operation.Therefore, since all of the undefective blocks in the super block SB5are logically arranged sequentially from the leading part of the superblock SB5 by this address translation operation, the super block SB5 canbe handled as if the super block SB5 were a small-size super blockincluding no defective blocks (i.e., a super block composed of sixundefective blocks). As a result, even if the data is long, the physicalstorage location of the data can be expressed by the only combination ofone physical address indicative of the starting physical storagelocation and one length.

Next, an example of the address translation operation and the defectinformation management table 33 used for the address translationoperation will be explained with reference to FIG. 43. In FIG. 43, theblock numbers are represented by hexadecimal digits.

The defect information management table 33 is indicative of accumulatednumber of defective blocks found from the leading part (from block ofsmallest block number). In FIG. 43, blocks having block numbers 4 and 9of the defect information management table 33 are defective blocks. Inthis case, in the defect information management table 33, “0” is storedat a location corresponding to block number 0, a location correspondingto block number 1, a location corresponding to block number 2, and alocation corresponding to block number 3, “1” is stored at a locationcorresponding to block number 4, a location corresponding to blocknumber 5, a location corresponding to block number 6, a locationcorresponding to block number 7, and a location corresponding to blocknumber 8, and “2” is stored at a location corresponding to block number9, a location corresponding to block number A, a location correspondingto block number B, a location corresponding to block number C, and alocation corresponding to block number D. In other words, the blockshaving the block numbers corresponding to the parts where the storednumerical values are changed are indicative of defective blocks.

Nonexistent numerical values are stored at locations corresponding toblock numbers E and F of the defect information management table 33. Ifthe bit number of the defect information per block is 2 bits, “3” isstored at the locations corresponding to block numbers E and F.

In addition, if the address translation operation is executed, the blocknumber of the block to be accessed is translated into a sum of the blocknumber of this block and the accumulated number of defective blocks. Forexample, block numbers 0 to 3 are invariable since the accumulatednumber of the defective blocks is “0” at the block numbers.

In contrast, for example, if the block number of the block to beaccessed is 4, the block number is incremented by +1 and translated intoblock number “5”. For this reason, if the block number of the block tobe accessed is 4, the data is actually written to the block having blocknumber “5”. The controller 4 notifies the host 2 of block number-4 asthe physical address of the write destination block. If the controller 4receives the read request to designate block number 4 as the physicaladdress of the block to be read, the controller 4 reads the data fromthe block having block number “5” since block number 4 is translatedinto block number “5”.

Similarly, if the block number of the block to be accessed is 5, theblock number is incremented by +1 and translated into block number “6”.For this reason, if the block number of the block to be accessed is 5,the data is actually written to the block having block number “6”. Thecontroller 4 notifies the host 2 of block number 5 as the physicaladdress of the write destination block. If the controller 4 receives theread request to designate block number 5 as the physical address of theblock to be read, the controller 4 reads the data from the block havingblock number “6” since block number 5 is translated into block number“6”.

FIG. 44 shows a relationship between the flash translation unit 2A inthe host 2 and the defective block translation unit 24 in the flashstorage device 3.

On the host 2 side, if the flash translation unit 2A executes datawrite, the flash translation unit 2A transmits a write command includingTag (for example, LBA) identifying the data to the flash storage device3. If the flash translation unit 2A uses API for super block, the flashtranslation unit 2A transmits to the flash storage device 3 a writecommand (Write without Page Address) designating the Tag (for example,LBA) identifying the data and the block address of the parallel unit.Since the parallel unit is implemented by one super block, the blockaddress of the parallel unit is the super block address of this superblock.

The flash storage device 3 is composed of true defective blocktranslation unit 24, the flash I/O control circuit 13, the defectinformation management table 33, and the NAND flash memory dies. Inaddition, the defect information holding at least 2-bit informationindicative of being available or unavailable for each block in eachsuper block is managed in the defect information management table 33.

If the defective block translation unit 24 receives from the host 2 sidethe write request including Tag (for example, LBA) which is theinformation to identify the data to be written, the defective blocktranslation unit 24 selects the undefective block in the super block tobe written as the write destination block and determines the writedestination location (write destination page, and offset in this page)in the selected block, by executing the address translation to translatethe address of the block to be accessed such that all of the undefectiveblocks included in the super block to be written are logically arrangedsequentially from the leading part of the super block to be written, byreferring to the defect information.

If the defective block translation unit 24 receives the write command todesignate the block address (super block address) of the parallel unit,the defective block translation unit 24 selects the super block havingthe designated block address (super block address) as the super block tobe written, by referring to the defect information.

Then, the defective block translation unit 24 transmits to the flash I/Ocontrol circuit 13 a write instruction designating the die identifier(Die ID) of the die to which the write destination block belongs, theblock address (Raw Block) of the write destination block, the writedestination page (Raw Page), and the offset (Offset) in the writedestination page.

In addition, the defective block translation unit 24 notifies the host 2of the Tag (for example, LBA) and the physical address indicative ofboth of the block to be accessed before address translation and thewrite destination location. The physical address may be represented bythe parallel unit indicative of the write destination super block andthe offset (Offset) in the super block. The parallel unit indicative ofthe write destination super block is the super block address of thewrite destination super block.

The flash I/O control circuit 13 having received the write instructionwrites the data to the write destination location, based on the writeinstruction.

On the host 2 side, if the flash translation unit 2A receives thephysical address (Parallel Unit, Offset) and the Tag (for example, LBA),the flash translation unit 2A updates the LUT managed by the host 2 andmaps the received physical address to the received Tag (for example,LBA).

When the flash translation unit 2A makes the read request, the flashtranslation unit 2A transmits the read request designating the physicaladdresses (Parallel Unit, Offset) to the flash storage device 3.

On the flash storage device 3 side, if the defective block translationunit 24 receives the read request to designate the physical addresses(Parallel Unit, Offset) from the host 2, the defective block translationunit 24 executes the above-explained address translation and translatesthe physical addresses (Parallel Unit, Offset) into the die identifier(Die ID), the block address (Law Block), the page address (Raw Page),and the offset (Offset) in the page. Then, the defective blocktranslation unit 24 transmits a write instruction designating the dieidentifier (Die ID), the block address (Raw Block), the page address(Raw Page), and the in-page offset (Offset) to the flash I/O controlcircuit 13. The flash I/O control circuit 13 reads the data, based onthe die identifier (Die ID), the block address (Raw Block), the pageaddress (Raw Page), and the in-page offset (Offset).

FIG. 45 shows a configuration example of the host 2 (computing system).

The host 2 (computing system) comprises a processor (CPU) 101, a mainmemory 102, a BIOS-ROM 103, a network controller 105, a peripheralinterface controller 106, a controller 107, an embedded controller (EC)108, and the like.

The processor 101 is a CPU configured to control operations of thecomponents of the computing system. The processor 101 executes variousprograms loaded from one of the plural flash storage devices 3 into themain memory 102. The main memory 102 is composed of a random accessmemory such as a DRAM. The programs executed by the processor 101include an application software layer 41, an operating system (OS) 42, afile system 43, a driver 44, and the like. A flash storage manager 45 isincluded in the file system 43. The flash storage manager 45 may beincluded in not the file system 43, but the driver 44.

The processor 101 also executes a basic input/output system (BIOS)stored in a BIOS-ROM 103 that is a nonvolatile memory. The BIOS is asystem program for hardware control.

The network controller 105 is a communication device such as a wired LANcontroller, a wireless LAN controller. The peripheral interfacecontroller 106 is configured to communicate with a peripheral devicesuch as a USB device.

The controller 107 is configured to execute communicate with devicesconnected to plural connectors 107A. The plural flash storage devices 3may be connected to the respective connectors 107A. The controller 107is an SAS expander, a PCIe switch, a PCIe expander, a RAID controller,or the like.

The EC 108 functions as a system controller configured to execute powermanagement for the computing system. The EC 108 powers on or powers offthe computing system in response to the user operation of the powerswitch. The EC 108 is implemented as a processing circuit such as aone-chip microcomputer.

The flash storage manager 45 is a program module which functions as theabove-explained flash translation unit 2A. The flash storage manager 45comprises the above-explained LUT which manages mapping between each ofthe user addresses (logical addresses) and each of the physicaladdresses of the flash storage device 3. If LBA is used as the useraddress (logical address), the flash storage manager 45 may be providedin the driver 44.

The flash storage manager 45 transmits to the flash storage device 3 thewrite command designating the user address (logical address) identifyingthe data to be written, and the length of the data. The flash storagemanager 45 receives from the flash storage device 3 the physical addressindicative of both of the write destination block selected from theblocks except the defective block by the flash storage device 3 and thewrite destination location in the write destination block, and theabove-explained user address (logical address), updates LUT, and mapsthis physical address to the user address (logical address). Morespecifically, the received physical address is indicative of both of thewrite destination block selected from the blocks except the defectiveblock included in one parallel unit as the write destination block bythe flash storage device 3, and the physical storage location in thewrite destination block to which the write data is written.

In addition, the flash storage manager 45 obtains the physical addressmapped to the user address (logical address) corresponding to the datato be read, by referring to LUT, and transmits the read commanddesignating this physical address to the flash storage device 3.

FIG. 46 shows a configuration example of the host (computing system) 2incorporating the flash storage device 3.

The computing system comprises a thin-box-shaped housing 201 which canbe accommodated in a rack. A large number of the flash storage devices 3may be disposed in the housing 201. In this case, the flash storagedevices 3 may be removably inserted into respective slots provided on afront surface 201A of the housing 201.

A system board (motherboard) 202 is disposed in the housing 201. Variouselectronic components including the CPU 101, the memory 102, the networkcontroller 105, and the controller 107 are mounted on the system hoard(motherboard) 202. The electronic components function as the host 2.

A flowchart of FIG. 47 shows steps of the write operation executed bythe host (computing system) 2.

The processor 101 of the host 2 executes the following steps by runninga computer program (the flash storage manager 45 or the like) stored inthe main memory 102.

In other words, the processor 101 determines whether the write commandneeds to be transmitted or not (step S201) and, if the write commandneeds to be transmitted (YES in step S201), the processor 101 transmitsto the flash storage device 3 the write command designating the useraddress of the data to be written, and the length of the data (stepS202). The write command may designate the user address of the data tobe written, a super block address indicative of one super block (oneparallel unit), and the length of the data.

After that, if the processor 101 receives a response (including the useraddress, the flash address, and the length) of write operationcompletion from the flash storage device 3 (YES in step S203), theprocessor 101 updates LUT (step S204). Then, the processor 101 transmitsthe Trim command to designate the physical address corresponding to theprevious data to the flash storage device 3, and instructs the flashstorage device 3 to invalidate the previous data (or to decrement thereference count indicative of the number of the logical addressesreferring to the previous data) (step S205).

A flowchart of FIG. 48 shows steps of the read operation executed by thehost 2.

The processor 101 determines whether the read command needs to betransmitted or not (step S301) and, if the read command needs to betransmitted (YES in step S301), the processor 101 transmits the readcommand designating the flash address and the length to the flashstorage device 3 (step S302).

After that, the processor 101 determines whether the read data has beenreceived or not (step S303) and, if the read data has been received (YESin step S303), the operation is completed.

A flowchart of FIG. 49 shows steps of reference countincrement/decrement processing executed by the host 2.

The processor 101 determines whether the duplication command to increasethe reference count of the previous data needs to be transmitted or not(step S401) and, if the duplication command needs to be transmitted (YESin step S401), the processor 101 transmits the duplication command tothe flash storage device 3 (step S402).

In addition, the processor 101 determines whether the Trim command todecrease the reference count of the previous data needs to betransmitted or not (step S403) and, if the Trim command needs to betransmitted (YES in step S403), the processor 101 transmits the Trimcommand to the flash storage device 3 (step S404).

As explained above, according to the embodiments, data write and readoperations for the parallel unit (super block) can be normally executedwithout replacing the defective block in the parallel unit (super block)to be written with the other block included in the die to which thisdefective block belongs. Therefore, even if the number of defectiveblocks is increased, a large amount of replacement information does notneed to be managed. In addition, since the address translationprocessing for replacement is also unnecessary, read latency can bereduced. Furthermore, since the same number of parallel units (superblocks) as the number of blocks belonging to each die can be basicallyconstructed, almost all of the undefective blocks can be used even ifthe number of the defective blocks is increased. Accordingly, influenceresulting from increase in the number of defective blocks can bereduced.

In addition, in the configuration in which the flash storage device 3determines the write destination block and the write destinationlocation in the write destination block and returns the physical addressindicative of both of the write destination block and the writedestination location to the host 2, merging the application-leveladdress translation table of the upper layer (host 2) and the LUT-leveladdress translation table of the conventional SSD can be implemented.

In the present embodiments, the NAND flash memory has been illustratedas a nonvolatile memory. However, the functions of the presentembodiment are also applicable to various other nonvolatile memoriessuch as a magnetoresistive random access memory (MRAM), a phase changerandom access memory (PRAM), a resistive random access memory (ReRAN)and a ferroelectric random access memory (FeRAM).

While certain embodiments have been described, these embodiments havebeen presented by way of example only, and are not intended to limit thescope of the inventions. Indeed, the novel embodiments described hereinmay be embodied in a variety of other forms; furthermore, variousomissions, substitutions and changes in the form of the embodimentsdescribed herein may be made without departing from the spirit of theinventions. The accompanying claims and their equivalents are intendedto cover such forms or modifications as would fall within the scope andspirit of the inventions.

What is claimed is:
 1. A memory system connectable to a host,comprising: a plurality of nonvolatile memory dies each including aplurality of blocks; and a controller electrically connected to thenonvolatile memory dies and configured to manage a plurality of parallelunits each including blocks belonging to different nonvolatile memorydies, each of the parallel units having a unique first block address,each of the blocks in each nonvolatile memory die having a unique secondblock address, the second block addresses of blocks to be included ineach parallel unit being determined from the first block address of eachparallel unit, based on a mathematical rule, wherein the controller isconfigured: to manage defect information holding at least 1-bitinformation indicative of being available or unavailable for each blockin each parallel unit; and when receiving from the host a write requestdesignating a third address to identify first data to be written, toselect one block from undefective blocks included in one parallel unitas a write destination block by referring to the defect information, todetermine a write destination location in the selected block, to writethe first data to the write destination location, and to notify the hostof a first physical address indicative of both of the selected block andthe write destination location, and the third address.
 2. The memorysystem of claim 1, wherein the first physical address includes a dieidentifier of the nonvolatile memory die to which the selected blockbelongs, a second block address corresponding to the selected block, andan offset from a leading part of the selected block to the writedestination location.
 3. The memory system of claim 2, wherein theoffset is represented by a page address of a page to which the writedestination location belongs, and an in-page offset corresponding to thewrite destination location.
 4. The memory system of claim 1, wherein thefirst physical address includes a first block address corresponding tothe one parallel unit, and a offset from the leading part of the oneparallel unit to the write destination location.
 5. The memory system ofclaim 4, wherein the offset is represented by a die identifier of thenonvolatile memory die to which the selected block belongs, a pageaddress of a page to which the write destination location belongs, andan in-page offset corresponding to the write destination location. 6.The memory system of claim 1, wherein the controller is configured, whenreceiving from the host a read request to designate the first physicaladdress, to read the data from the write destination location in theselected block, based on the first physical address.
 7. The memorysystem of claim 1, wherein the controller is configured, when receivingfrom the host a parallel unit allocate request to designate the numberof blocks capable of parallel access, to select a parallel unitincluding more number of undefective blocks than the number ofdesignated blocks from the parallel units, and to allocate the selectedparallel unit to the host, and the one parallel unit is the selectedparallel unit allocated to the host.
 8. The memory system of claim 1,wherein the controller is configured to write plural data portions andan erasure code calculated from the plural data portions, across pluralpages that have the same page address and that belong to blocks includedeach parallel unit, the erasure code is calculated by assuming that apredetermined value is stored in a page in each defective block in eachparallel unit, and the erasure code is written to a page in anundefective block in each parallel unit.
 9. The memory system of claim8, wherein the controller is configured to execute decoding using theerasure code by assuming that the predetermined value is stored in thepage in each defective block in each parallel unit.
 10. The memorysystem of claim 1, wherein the write request designates the thirdaddress, and a first block address corresponding to one parallel unit,and the controller is configured: to select a parallel unit having thefirst block address designated by the write request from the parallelunits, and to select one block from undefective blocks included in theselected parallel unit as the write destination block, by referring tothe defect information.
 11. A memory system connectable to a host,comprising: a plurality of nonvolatile memory dies each including aplurality of blocks; and a controller electrically connected to thenonvolatile memory dies and configured to manage a plurality of parallelunits each including blocks belonging to different nonvolatile memorydies, each of the parallel units having a unique first block address,each of the blocks in each nonvolatile memory die having a unique secondblock address, the second block addresses of blocks to be included ineach parallel unit being determined from the first block address of eachparallel unit, based on a mathematical rule, wherein the controllerconfigured: to manage defect information holding at least 1-bitinformation indicative of being available or unavailable for each blockin each parallel unit; when receiving from the host a write requestdesignating a third address to identify first data to be written, toselect an undefective block in a parallel unit to be written as a writedestination block by (i) selecting one block from undefective blocksincluded in the parallel unit by referring to the defect information, or(ii) by executing address translation of translating an address of ablock to be accessed so as to allow all undefective blocks in theparallel unit to be logically arranged sequentially from a leading partof the parallel unit, based on the defect information; to determine awrite destination location in the selected block; to write the firstdata to the write destination location; and to notify the host of aphysical address indicative of both of the selected block and the writedestination location, and the third address, or a physical addressindicative of both of the block to be accessed before the addresstranslation and the write destination location, and the third address.12. A method of controlling a plurality of nonvolatile memory dies eachincluding a plurality of blocks, the method comprising: managing aplurality of parallel units each including blocks belonging to differentnonvolatile memory dies; each of the plural parallel units having aunique first block address, each of the blocks in each nonvolatilememory die having a unique second block address, the second blockaddresses of blocks to be included in each parallel unit beingdetermined from the first block address of each parallel unit, based ona mathematical rule, managing defect information holding at least 1-bitinformation indicative of being available or unavailable for each blockin each parallel unit; and executing, when receiving from a host a writerequest designating a third address to identify first data to bewritten, an operation of selecting one block from undefective blocksincluded in one parallel unit as a write destination block by referringto the defect information, an operation of determining a writedestination location in the selected block, an operation of writing thefirst data to the write destination location, and an operation ofnotifying the host of a first physical address indicative of both of theselected block and the write destination location, and the thirdaddress.
 13. The method of claim 12, further comprising: when receivingfrom the host a read request to designate the first physical address,reading the data from the write destination location in the selectedblock, based on the first physical address.
 14. The method of claim 12,further comprising: executing, when receiving from the host a parallelunit allocate request to designate the number of blocks capable ofparallel access, an operation of selecting a parallel unit includingmore number of undefective blocks than the number of designated blocksfrom the parallel units, and an operation of allocating the selectedparallel unit to the host, wherein the one parallel unit is the selectedparallel unit allocated to the host.